﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SES.CMS.BL;
using SES.CMS.DO;

namespace SES.CMS.Module
{
    public partial class ucProductAlsoBuy : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
            {
                int ID = int.Parse(Request.QueryString["ID"]);
                if (new cmsSanPhamBL().SelectBySanPhamID(ID).Rows.Count > 0)
                {
                    int loaiSanPhamID = int.Parse(new cmsSanPhamBL().SelectBySanPhamID(ID).Rows[0]["LoaiSanPhamID"].ToString());
                    rptproDataSource(loaiSanPhamID);
                }
            }

        }

        protected void rptproDataSource(int loaiSanPhamID)
        {

            rptpro.DataSource = new cmsSanPhamBL().SelectByLoaiSanPhamID(loaiSanPhamID);
            rptpro.DataBind();
 
        }
        protected string FriendlyUrl(string strTitle)
        {
            return Ultility.Change_AV(strTitle);
        }
    }
}